#!/usr/bin/env python3
"""
@Author: xueyuankui
@Date:   2022-01-22
@email: xueyuankui.good@163.com
@Function: The API used for communication with Airsim simulator
"""

from .mavlink.mavlink_common import *


class PX4_TYPE_MASK:
    """
    Type mask class
    """
    MASK_NED_VEL_YAWRATE = POSITION_TARGET_TYPEMASK_X_IGNORE | POSITION_TARGET_TYPEMASK_Y_IGNORE | POSITION_TARGET_TYPEMASK_Z_IGNORE | \
        POSITION_TARGET_TYPEMASK_AX_IGNORE | POSITION_TARGET_TYPEMASK_AY_IGNORE | POSITION_TARGET_TYPEMASK_AZ_IGNORE | \
        POSITION_TARGET_TYPEMASK_FORCE_SET + POSITION_TARGET_TYPEMASK_YAW_IGNORE
    MASK_NED_VEL_YAW = POSITION_TARGET_TYPEMASK_X_IGNORE | POSITION_TARGET_TYPEMASK_Y_IGNORE | POSITION_TARGET_TYPEMASK_Z_IGNORE | \
        POSITION_TARGET_TYPEMASK_AX_IGNORE | POSITION_TARGET_TYPEMASK_AY_IGNORE | POSITION_TARGET_TYPEMASK_AZ_IGNORE | \
        POSITION_TARGET_TYPEMASK_FORCE_SET + POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE
    MASK_NED_POS_YAW = POSITION_TARGET_TYPEMASK_VX_IGNORE | POSITION_TARGET_TYPEMASK_VY_IGNORE | POSITION_TARGET_TYPEMASK_VZ_IGNORE | \
        POSITION_TARGET_TYPEMASK_AX_IGNORE | POSITION_TARGET_TYPEMASK_AY_IGNORE | POSITION_TARGET_TYPEMASK_AZ_IGNORE | \
        POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE
    MASK_NED_ACC_YAWRATE = POSITION_TARGET_TYPEMASK_X_IGNORE | POSITION_TARGET_TYPEMASK_Y_IGNORE | POSITION_TARGET_TYPEMASK_Z_IGNORE | \
        POSITION_TARGET_TYPEMASK_VX_IGNORE | POSITION_TARGET_TYPEMASK_VY_IGNORE | POSITION_TARGET_TYPEMASK_VZ_IGNORE | \
        POSITION_TARGET_TYPEMASK_YAW_IGNORE
    MASK_NED_ACC_YAW = POSITION_TARGET_TYPEMASK_X_IGNORE | POSITION_TARGET_TYPEMASK_Y_IGNORE | POSITION_TARGET_TYPEMASK_Z_IGNORE | \
        POSITION_TARGET_TYPEMASK_VX_IGNORE | POSITION_TARGET_TYPEMASK_VY_IGNORE | POSITION_TARGET_TYPEMASK_VZ_IGNORE | \
        POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE


class PX4_FRAME:
    """
    Frame
    """
    FRAME_GLOBAL_ALT = 5
    FRAME_GLOBAL_RELATIVE_ALT = 6
    FRAME_GLOBAL_TERRAIN_ALT = 11


class PX4_FLIGHT_MODE:
    """
    Flight mode class
    """
    MANUAL = 0x10000
    ALTITUDE = 0x20000
    POSITION = 0x30000
    OFFBOARD = 0x60000
    STABILIZED = 0x70000
    TAKEOFF = 0x2040000
    HOLD = 0x3040000
    RETURN = 0x5040000
    LAND = 0x6040000
